permutations and combinations tricks for cat